namespace Collaboris.Saf.Actions.Wss.Tests.Generated
{
    using System.IO;

    using Engine.Report;

    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Saf.Tests;

    using Wss.ContentMigration;
    using TestHelper = Collaboris.Saf.Actions.Wss.Tests.TestHelper;
    using SharePoint.Wss.ContentMigration;

    [TestClass]
    public class ExportListItemTest
    {
        [TestMethod]
        public void ExportListItem_Test()
        {
            WSSTestAssistant<ExportListItem, ListItemExportSettings> exportlistitem =
                    new WSSTestAssistant<ExportListItem, ListItemExportSettings>(TestEnvironment.PublishingSite, 
                        "ExportListItemTestWeb", "BLANKINTERNET#0");

            using (exportlistitem)
            {
                string filename = Path.Combine(
                exportlistitem.FirstEntity.ExportSettings.FileLocation,
                exportlistitem.FirstEntity.ExportSettings.BaseFileName);

                if (System.IO.File.Exists(filename))
                {
                    System.IO.File.Delete(filename);
                }

                // creates a test person list
                TestHelper.CreateTasksList(exportlistitem.TestWeb, true, true);

                MacroReport doReport = exportlistitem.DoMacro();

                Assert.IsTrue(File.Exists(filename));

                // this should now - hopefully - go an import the list into the new web...
                ImportListItemTest importListItemTest = new ImportListItemTest();
                importListItemTest.ImportListItem_Test();

            
            }
        }

    }
}
